<%@page import="java.util.Calendar"%>
<%@page import="com.sun.xml.internal.ws.api.Cancelable"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<h1>1.脚本</h1>
	<%
		//可以写任何的java代码
		if (Calendar.getInstance().get(Calendar.AM_PM) == Calendar.AM) {
			out.print("上午好，游客！");
		} else {
			out.print("下午好，游客！");
		}

		//for(int i=0;i<100;i++)
		//{
		//	out.println(i+"<br>");
		//}

		// service方法中的局部变量
		int x = 10;
		x++;
		out.println("<br/>");
		out.println("x=" + x);
	%>

	<h1>2. 声明成员变量</h1>
	<%!int y = 20;%>
	<%
		y++;
		out.println("<br/>");
		out.println("y=" + y);
	%>


	<h1>3. 表达式</h1>
	x=<%=x%><br /> y=<%=y%><br /> x+y=<%=x + y%>

</body>
</html>